
package com.sijibao.gather.producer.kafka;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;
import com.sijibao.gather.event.Event;
import com.sijibao.gather.producer.Producer;

public class CommonProducerImpl extends KafkaProducerAdapter implements Producer
{
	private static final Logger logger=LoggerFactory.getLogger(CommonProducerImpl.class);
	@Override
	public void produce(Event event)
	{
		String value = JSON.toJSONString(event);
		sent(value);
	}

	@Override
	public void close()
	{
		logger.info("Producer Begin Destroy...");
		super.close();
		logger.info("Producer Destroy Success");
	}

}
